/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package slideshow;

import java.io.IOException;
import javax.swing.JButton;
import javax.swing.JPanel;

/**
 *
 * @author Andrea
 */
public class MainPanel extends JPanel {
    
    public JButton lbButtonNext;
    public JButton lbButtonPrevious;
    public ImagePanelZwei lipzImagePanel;

    public ListImages llListImages;
    
    public int liIndex;
    
    public MainPanel ( String asPath, MainWindow amwMainWindow ) throws IOException {

        super();

        liIndex = 0;
        
        llListImages = new ListImages ( asPath );
        lipzImagePanel = new ImagePanelZwei ();
        
        lbButtonNext = new JButton ( "Next >" );
        lbButtonPrevious = new JButton ( "< Previous" );
        
        if ( liIndex == 0 ) {
            
            lbButtonPrevious.setEnabled ( false );
            
        }
        
        lbButtonNext.addActionListener ( new NextImage ( this, amwMainWindow ) );
        lbButtonPrevious.addActionListener ( new PreviousImage ( this, amwMainWindow ) );
        
        this.add ( lbButtonPrevious );
        this.add ( lbButtonNext );
        this.add ( lipzImagePanel );
        
    }
    
}
